package top.infopub.job.quartz.exec;


import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import top.infopub.job.quartz.exec.base.BaseJob;
import top.infopub.job.sts.service.StsQaJobCoreService5_6;
import top.infopub.util.DateUtil;
import top.infopub.util.SpringContext;


/**
 * 总部/区域/项目经营质量分析指标-5=管理费用  6=管理费率  数据归集job </br>
 * 月初统计上一个月的
 * @author Awoke
 * @version 2020年2月13日
 * @see StsQaOfMgrFeeRateJob
 * @since
 */
public class StsQaOfMgrFeeRateJob extends BaseJob {

    private static StsQaJobCoreService5_6 stsQaJobCoreService;

    static {
        stsQaJobCoreService = SpringContext.getBean(StsQaJobCoreService5_6.class);
    }

    public StsQaOfMgrFeeRateJob() {}

    @Override
    public void execute(JobExecutionContext context)
        throws JobExecutionException {
        try {
            String start = DateUtil.currentDateDef();
            log.info("StsQaOfMgrFeeRateJob开始时间：{}", start);
            stsQaJobCoreService.stsQaOfMgrFeeRateJob();
            String end = DateUtil.currentDateDef();
            log.info("StsQaOfMgrFeeRateJob结束时间：{}", end);
            logSucceed("总部/区域/项目经营质量分析指标-管理费用/费率 归集完成，开始时间：" + start + "，结束时间：" + end);
        }
        catch (Exception e) {
            log.error("总部/区域/项目经营质量分析指标-管理费用/费率 数据归集error", e);
            logFail(e, true);
        }
    }
}
